export default function rsaEncrypt(data) {
  // 公钥
  const PUBLIC_KEY = `-----BEGIN PUBLIC KEY-----
	MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDn3Em30dij6RbUH+rbKfMyAflU
	A7jNAGWvDNtJN11VUm5NEFAuxITgaCzcYvljEtZnRw+ZS2WeuLoFu/oX24swzLrv
	0ODvxxO4P+QXSwv/dSpgA1BAXnzaRgA3czxelNjpaBMGLPQJpW8wucjFAVQjxWGE
	TEhZ9wC8kNBy57cNIwIDAQAB
	-----END PUBLIC KEY-----`;

  // 使用公钥加密
  const NodeRSA = require('node-rsa');
  const publicRSA = new NodeRSA(PUBLIC_KEY);
  const encrypted = publicRSA.encrypt(data, 'base64');
  return encrypted;
};
